using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace FlyOutMenu
{
	[Activity (Label = "FlyInMenu", MainLauncher = true, Theme = "@android:style/Theme.Holo.Light.NoActionBar")]
	public class Activity1 : Activity
	{
		bool flag=true;
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			Button btn1 = FindViewById<Button> (Resource.Id.button1);
			var cont1 = FindViewById<LinearLayout> (Resource.Id.content1);
			var cont2 = FindViewById<LinearLayout> (Resource.Id.content2);
			cont2.Visibility=ViewStates.Visible;
			cont1.Visibility=ViewStates.Gone;

			var menu = FindViewById<FlyOutContainer> (Resource.Id.FlyOutContainer);
			var menuButton = FindViewById (Resource.Id.MenuButton);
			menuButton.Click += (sender, e) => {
				menu._boolFlag=false;
				menu.AnimatedOpened = !menu.AnimatedOpened;
			};
			btn1.Click += delegate{
				menu._boolFlag=true;
				menu.AnimatedOpened = !menu.AnimatedOpened;
				if (flag) {
					cont2.Visibility=ViewStates.Gone;
					cont1.Visibility=ViewStates.Visible;
					flag=false;
				}else
				{
					cont2.Visibility=ViewStates.Visible;
					cont1.Visibility=ViewStates.Gone;
					flag=true;
				}

			};
		}
	}
}


